<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
include "connection.php";



$q1  = $_REQUEST['q1'];

$q2  = $_REQUEST['q2'];

$q3  = $_REQUEST['q3'];

$q4  = $_REQUEST['q4'];

$q5  = $_REQUEST['q5'];

$q6  = $_REQUEST['q6'];

$q7  = $_REQUEST['q7'];

$q8  = $_REQUEST['q8'];

$q9  = $_REQUEST['q9'];

$q10 = $_REQUEST['q10'];


$remark     = $_REQUEST['remark'];
$best_meal  = $_REQUEST['best_meal'];
$worst_meal = $_REQUEST['worst_meal'];
$datetime   = $_REQUEST['datetime'];
$user_id    = $_REQUEST['user_id'];
$user_name  = $_REQUEST['user_name'];



$tableProduct = "feedback";




$sql = "insert into $tableProduct (
q1,
q2,
q3,
q4,
q5,
q6,
q7,
q8,
q9,
q10,
remark,
best_meal,
worst_meal,
datetime,
user_id,
user_name
) value (
'$q1',
'$q2',
'$q3',
'$q4',
'$q5',
'$q6',
'$q7',
'$q8',
'$q9',
'$q10',
'$remark',
'$best_meal',
'$worst_meal',
'$datetime',
'$user_id',
'$user_name'
)";



session_start();
if($_SESSION['code'])
{
    $query = mysql_query($sql) or die ("提交失败，请重试！");
    $_SESSION['code']=FALSE;
}



?>
<script type="text/javascript">
    alert("调查表提交成功。");
    document.location = "../feedback.php";
</script>
</body>
</html>